home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magazyn Click 1 (Special Issue)
/
fantasy.iso
/
Demo The Druid King
/
DemoMap.pak
/
SEQUENCES_S02_MAIN.VS
< prev
next >
Wrap
Text File
|
2001-04-11
|
5KB
|
220 lines
// void
NamedObj Daranix, Keltill;
Daranix = GetNamedObj("Daranix");
Keltill = GetNamedObj("Keltill");
// Where to place the item holder?
// Item holder passability
/*************************************/
/************* STUB CODE *************/
/*************************************/
/* ObjSet GaulArmy;
cls();
PlayersShareView(1,3);
View(point(1600,13000),false);
// spawn Keltill
Keltill = CreateNamedObj("Keltill", PlaceEx("Keltill", 2000, 12250, 1));
// spawn gaul army
PlaceBlockEx("GHorseman", 1, 2000, 12300, 12, 1, 50, 50, "GaulArmy");
PlaceBlockEx("GHorseman", 1, 2000, 12350, 12, 2, 50, 50, "GaulArmy");
GaulArmy = GetObjSet("GaulArmy");
GaulArmy.AddCommand(true,"attach", Keltill.obj);
GaulArmy.KillCommand();
Daranix = CreateNamedObj("Daranix", PlaceEx("Daranix", 1600, 12500, 1));*/
/*************************************/
/*********** STUB CODE END ***********/
/*************************************/
PlayersShareView(1,4); // Player 4 is used to temporarily disallow control of some units
PlayersAlly(1,4);
PlayersAlly(1,6); // Player 6 is used while Daranix and his army are outside the map, so they do not reveal the fog
// Place the item holder with the item in it
{
ItemHolder holder;
holder = PlaceEx("DefItemHolder2", 1660, 14150, 8);
holder.CreateItem("box");
}
// Give note and wait for completion
EnvWriteString("/NewNote", 4); // *** Prepare the army that will go to Ludgunum ***
Run("CurrentMap/mission_notes.vs");
while (Daranix.obj.AsHero().army.Count()<35 || Daranix.obj.DistTo(Keltill.obj)>350) {
Sleep(500);
}
// Trigger the conversation and remove note
{
Conversation c;
EnvWriteString("/DM C7/CalledFromSeq","2");
c.Init("DM C7", 2, 0);
c.Run();
}
EnvWriteInt("/Note4", 0);
// Give note and wait for completion
EnvWriteString("/NewNote", 10); // *** Note: Go towards Ludgunum with Daranix and his army ***
Run("CurrentMap/mission_notes.vs");
{
TRect rc;
rc.Set(709, 14489, 1629, 15981);
while (Daranix.obj.AsHero().army.Count()<35 || !ptInRect(Daranix.obj.pos, rc)) {
Sleep(500);
}
}
// Now let Daranix finish his journey
ClearSelection();
{
ObjList army;
int i;
Daranix.obj.SetPlayer(4);
army = Daranix.obj.AsHero().army;
for (i=0;i<army.Count();i+=1)
army[i].SetPlayer(4);
}
Daranix.obj.AddCommand(true, "move", point(1000,16300));
Daranix.obj.KillCommand();
while (Daranix.obj.script!="idle") {
Sleep(500);
}
// Move him outside the map and remove the note
{
ObjList army;
int i;
TPoint vector;
vector.Set(0,460);
if (Daranix.obj.pos.y+vector.y > 16360)
Daranix.obj.SetPos(point(Daranix.obj.pos.x, 16360));
else
Daranix.obj.SetPos(Daranix.obj.pos+vector);
Daranix.obj.SetPlayer(6);
army = Daranix.obj.AsHero().army;
for (i=0;i<army.Count();i+=1)
{
if (army[i].pos.y+vector.y > 16360)
{ army[i].SetPos(point(army[i].pos.x, 16360)); }
else
{ army[i].SetPos(army[i].pos+vector); }
army[i].SetPlayer(6);
}
}
EnvWriteInt("/Note10", 0);
//RunSequence("s04_main");
Sleep(10000);
// Send back a messenger
{
Unit messenger;
Conversation c;
messenger = PlaceEx("GaulMessenger1", 1100, 15950, 4).AsUnit();
messenger.ClearCommands();
messenger.AddCommand(true, "approach", Keltill.obj);
messenger.KillCommand();
while (messenger.script!="idle") {
Sleep(500);
}
c.Init("DM C8", 2, 0);
c.SetActor("Messenger", messenger, "");
c.Run();
messenger.SetPlayer(1);
messenger.AddCommand(true, "move", messenger.pos+point(100,-200));
messenger.KillCommand();
}
Sleep(10000);
// Send back the reduced Daranix army
{
ObjList army;
int i, to_kill;
// Black magic: Kill each other unit from the Daranix army
to_kill = Daranix.obj.AsHero().army.Count()/2;
for (i=0;i<to_kill;i+=1)
Daranix.obj.AsHero().army[i].Kill();
// Reduce some health from the other
army = Daranix.obj.AsHero().army;
for (i=0;i<army.Count();i+=1)
army[i].Damage(rand(army[i].health/2));
// Move him back on the map
{
ObjList army;
int i;
TPoint vector;
vector.Set(0,-460);
Daranix.obj.SetPos(Daranix.obj.pos+vector);
Daranix.obj.SetPlayer(4);
army = Daranix.obj.AsHero().army;
for (i=0;i<army.Count();i+=1)
{
army[i].SetPos(army[i].pos+vector);
army[i].SetPlayer(4);
}
for (i=0;i<army.Count();i+=1)
if (army[i].OnImpassable())
army[i].Delete();
}
Daranix.obj.ClearCommands();
Daranix.obj.AddCommand(true, "approach", Keltill.obj);
Daranix.obj.KillCommand();
while (Daranix.obj.script!="idle") {
Sleep(500);
}
army = Daranix.obj.AsHero().army;
Daranix.obj.SetPlayer(1);
for (i=0;i<army.Count();i+=1)
army[i].SetPlayer(1);
}
while (1) {
// TODO: Maybe check for this in the last delay cycle
if (Daranix.obj.DistTo(Keltill.obj)<Daranix.obj.sight+200)
{
Conversation c;
c.Init("DM C9", 2, 0);
c.Run();
break;
}
Sleep(1000);
}
// Run sequence 4
RunSequence("s04");